package com.atwork.wuhua.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.atwork.wuhua.R;
import com.atwork.wuhua.bean.EvaluateSelectBean;
import com.atwork.wuhua.bean.TypeSelectRegionBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class TypeSelectEvaluateAdapter extends BaseQuickAdapter<EvaluateSelectBean, BaseViewHolder> {
    private Context context;

    public TypeSelectEvaluateAdapter(Context context, int layoutResId, @Nullable List<EvaluateSelectBean> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, EvaluateSelectBean item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.addOnClickListener(R.id.rly_click);
        if (item.isSelect()) {
            helper.getView(R.id.img_select).setVisibility(View.VISIBLE);
            ((TextView) helper.getView(R.id.tv_name)).setTextColor(context.getResources().getColor(R.color.A4d98de));
        } else {
            helper.getView(R.id.img_select).setVisibility(View.GONE);
            ((TextView) helper.getView(R.id.tv_name)).setTextColor(context.getResources().getColor(R.color.A666));
        }
    }
}
